Skip to content

Conversation

@muhammad-othman
Copy link
Member

@muhammad-othman muhammad-othman commented Dec 19, 2025

Description

Modified error response unmarshalling to directly update errorResponse object instead of using intermediate variables. For AWS Query compatible services, error codes are now extracted and set on the errorResponse object within the generate AWSQueryCompatibleBlock, this allowed us to remove conditional AWS Query compatible checks in JsonRPCExceptionUnmarshaller since the errorResponse already contains the proper code and type.

Motivation and Context

DOTNET-8439

Testing

  • Tested some SQS and CloudWatch operations manually and made sure they are throwing the proper exceptions.
  • DRY_RUN-71a1a982-8709-48d3-a99a-c6d4c5251dd8

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@peterrsongg peterrsongg self-requested a review December 19, 2025 23:35
Copy link
Contributor

@peterrsongg peterrsongg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified it works in a console app myself. approved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors AWS Query compatible error handling in unmarshallers to improve code organization and eliminate duplication. The key change moves error code/type extraction from the AWS Query compatible header to occur earlier in the unmarshalling process and directly updates the errorResponse object, which allows removal of redundant AWS Query compatible checks from individual exception unmarshallers.

  • Consolidated AWS Query compatible error code/type extraction to occur once per response instead of per exception
  • Eliminated duplicate AWS Query compatible logic from individual exception unmarshallers
  • Introduced errorTypeName variable to preserve the original error code for exception matching before AWS Query header override

Reviewed changes

Copilot reviewed 7 out of 117 changed files in this pull request and generated no comments.

Show a summary per file
File Description
generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt Updated AWS Query compatible block to directly modify errorResponse.Code and errorResponse.Type
generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt Moved AWS Query compatible block before exception matching and introduced errorTypeName variable
generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt Removed duplicate AWS Query compatible logic from exception unmarshallers
sdk/src/Services/SQS/Generated/Model/Internal/MarshallTransformations/* Applied template changes to all SQS response unmarshallers
sdk/src/Services/CloudWatch/Generated/Model/Internal/MarshallTransformations/* Applied template changes to all CloudWatch response unmarshallers
sdk/test/Services/QueryCompatible*/Generated/Model/Internal/MarshallTransformations/* Applied template changes to test service unmarshallers
generator/.DevConfigs/78714232-60db-41f4-8696-7764cc7bd5c9.json Added dev config with patch version bump for SQS and CloudWatch

@muhammad-othman muhammad-othman merged commit c472345 into aws-sdk-net-v3.7-development Dec 22, 2025
9 of 10 checks passed
@muhammad-othman muhammad-othman deleted the muhamoth/DOTNET-8439-v3-bug-AWS-Query-protocol-migration-compatibility branch December 22, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants